package com.pwc.conversionTool.dao;

import static com.pwc.conversionTool.entity.service.OfyService.ofy;

import java.util.List;

import com.googlecode.objectify.Key;
import com.pwc.conversionTool.entity.Account;
import com.pwc.conversionTool.entity.SoapConnection;

public class SoapConnectionDao {
	
	public Key<SoapConnection> saveAccount(SoapConnection soapConnection)
	{
		return ofy().save().entity(soapConnection).now();
	}
	
	
	
	public List<SoapConnection> getAllConnections(Key<Account> account)
	{
		return ofy().load().type(SoapConnection.class).filter("account", account).list();
	}



	public void deleteSoapConnection(Long id) {
		
		ofy().delete().type(SoapConnection.class).id(id).now();
		
	}



	public SoapConnection getSoapConnectionById(Long id) {
		
		return ofy().load().type(SoapConnection.class).id(id).now();
	}

}
